package cn.sccdlg.lambda.demo04.controller;

import cn.sccdlg.lambda.demo04.pojo.Dept;
import cn.sccdlg.lambda.demo04.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/6/7 22:15
 * 部门Controller
 */
@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private DeptService deptService;

    @GetMapping("/list")
    public List<Dept> listAllDept() {
        return deptService.findAllDept();
    }
}
